package com.xxl.job.sscMemberSysmessage.service.impl;

import com.xxl.job.common.utils.DateUtils;
import com.xxl.job.sscMemberSysmessage.domain.SscMemberSysmessage;
import com.xxl.job.sscMemberSysmessage.domain.SscMemberSysmessageVo;
import com.xxl.job.sscMemberSysmessage.mapper.SscMemberSysmessageMapper;
import com.xxl.job.sscMemberSysmessage.service.ISscMemberSysmessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员接收系统消息推送中间Service业务层处理
 *
 * @author zyc
 * @date 2023-08-30 11:53:26
 */
@Service
public class SscMemberSysmessageServiceImpl implements ISscMemberSysmessageService {
    @Autowired
    private SscMemberSysmessageMapper sscMemberSysmessageMapper;

    /**
     * 查询会员接收系统消息推送中间
     *
     * @param memberSysmessageId 会员接收系统消息推送中间主键
     * @return 会员接收系统消息推送中间
     */
    @Override
    public SscMemberSysmessageVo selectMemberSysMsgById(Long memberSysmessageId) {
        return sscMemberSysmessageMapper.selectMemberSysMsgById(memberSysmessageId);
    }

    /**
     * 查询会员接收系统消息推送中间列表
     *
     * @param sscMemberSysmessage 会员接收系统消息推送中间
     * @return 会员接收系统消息推送中间
     */
    @Override
    public List<SscMemberSysmessageVo> selectSscMemberSysMsgList(SscMemberSysmessage sscMemberSysmessage) {
        return sscMemberSysmessageMapper.selectSscMemberSysMsgList(sscMemberSysmessage);
    }

    /**
     * 新增会员接收系统消息推送中间
     *
     * @param sscMemberSysmessage 会员接收系统消息推送中间
     * @return 结果
     */
    @Override
    public int insertSscMemberSysMessage(SscMemberSysmessage sscMemberSysmessage) {
        sscMemberSysmessage.setCreateTime(DateUtils.getCountryNowTime());
        sscMemberSysmessage.setCreateDate(DateUtils.getCountryNowTime());
        return sscMemberSysmessageMapper.insertSscMemberSysMessage(sscMemberSysmessage);
    }

}
